package cn.iocoder.yudao.module.scrm.controller.admin.invoice.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.module.scrm.annotations.DictField;
import cn.iocoder.yudao.module.scrm.controller.admin.commom.vo.FileInfoVO;
import cn.iocoder.yudao.module.scrm.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
import static cn.iocoder.yudao.module.scrm.enums.DictTypeConstants.*;

@Schema(description = "管理后台 - 发票 Response VO")
@Data
@ExcelIgnoreUnannotated
public class InvoiceRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11746")
    //@ExcelProperty("主键")
    private Long id;

    @Schema(description = "订单号", example = "14738")
    //@ExcelProperty("订单号")
    private Integer orderId;

    @Schema(description = "订单标题", example = "2138")
    @ExcelProperty("订单标题")
    private String orderTitle;

    @Schema(description = "客户编号", example = "11871")
    //@ExcelProperty("客户编号")
    private Long customerId;

    @Schema(description = "客户名称", example = "杨")
    @ExcelProperty("客户名称")
    private String customerName;

    @Schema(description = "合同编号", example = "28282")
    //@ExcelProperty("合同编号")
    private Long contractId;

    @Schema(description = "负责人编号", example = "7485")
    //@ExcelProperty("负责人编号")
    private Long ownerUserId;

    @Schema(description = "负责人名称", example = "杨")
    @ExcelProperty("负责人名称")
    private String ownerUserName;

    @Schema(description = "负责人部门")
    @ExcelProperty("负责人部门")
    private String ownerUserDeptName;

    @DictField(dictType = CRM_INVOICE_TYPE)
    @ExcelProperty(value = "发票类型" , converter = DictConvert.class)
    @DictFormat(CRM_INVOICE_TYPE)
    @Schema(description = "发票类型", example = "2")
    private String invoiceType;

    private String invoiceTypeLabel;

    @Schema(description = "出票公司")


    @DictField(dictType = COMPANY_NAME)
    @ExcelProperty(value = "出票公司" , converter = DictConvert.class)
    @DictFormat(COMPANY_NAME)
    private String ticketCompany;

    private String ticketCompanyLabel;

    @Schema(description = "公司全称", example = "张三")
    @ExcelProperty("公司全称")
    private String companyName;

    @Schema(description = "纳税人识别号")
    @ExcelProperty("纳税人识别号")
    private String taxNumber;

    @Schema(description = "注册地址")
    @ExcelProperty("注册地址")
    private String address;

    @Schema(description = "企业电话")
    @ExcelProperty("企业电话")
    private String phoneNumber;

    @Schema(description = "客户对公账户", example = "31814")
    @ExcelProperty("客户对公账户")
    private String account;

    @Schema(description = "开票项目名称", example = "张三")
    @ExcelProperty(value = "开票项目名称" , converter = DictConvert.class)
    @DictFormat(INVOICING_ITEMS)
    @DictField(dictType = INVOICING_ITEMS)
    private String projectName;


    private String projectNameLabel;

    @Schema(description = "开票金额", example = "21492")
    @ExcelProperty("开票金额")
    private BigDecimal price;

    @Schema(description = "会议（峰会）场次")
    @ExcelProperty("会议（峰会）场次")
    private String meetingVenue;

    @Schema(description = "邀约人")
    //@ExcelProperty("邀约人")
    private String inviter;


    private String inviterName;

    @Schema(description = "是否报课")

    @DictField(dictType = DictTypeConstants.SUBJECT_TYPE)
    @ExcelProperty(value = "是否报课" , converter = DictConvert.class)
    @DictFormat(SUBJECT_TYPE)
    private String enroll;

    private String enrollLabel;

    @Schema(description = "接收发票手机号码")
    @ExcelProperty("接收发票手机号码")
    private String acceptPhone;

    @Schema(description = "接收电子发票邮箱")
    @ExcelProperty("接收电子发票邮箱")
    private String acceptEmail;

    @Schema(description = "附件信息")
    //@ExcelProperty("附件信息")
    private List<FileInfoVO> attachment;

    @Schema(description = "图片-附件信息")
    private List<FileInfoVO> pictureAttachment;

    @Schema(description = "工作流编号", example = "6450")
    //@ExcelProperty("工作流编号")
    private Long processInstanceId;

    @Schema(description = "审批状态", example = "2")
    @ExcelProperty(value = "审批状态" , converter = DictConvert.class)
    @DictFormat(SCRM_AUDIT_STATUS)
    @DictField(dictType = DictTypeConstants.SCRM_AUDIT_STATUS)
    private Integer auditStatus;

    @Schema(description = "审批状态", example = "2")
    private String auditStatusLabel;

    @Schema(description = "备注信息", example = "你说的对")
    @ExcelProperty("备注信息")
    private String remark;

    @Schema(description = "创建人id")
    private Long creator;

    @Schema(description = "创建人姓名")
    @ExcelProperty("创建人姓名")
    private String creatorName;

    @Schema(description = "创建时间")
    @ExcelProperty("创建时间")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @ExcelProperty("更新时间")
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
    private LocalDateTime updateTime;

    @Schema(description = "收件地址")
    @ExcelProperty("收件地址")
    private String deliveryAddress;

    @Schema(description = "邀约人部门")
    //@ExcelProperty("邀约人部门")
    private String inviterDept;

    /**
     * 发票编号
     */
    @Schema(description = "发票")
    @ExcelProperty("发票编号")
    private String no;


}